package com.biaoyoo.www.personapp.widget.pull;

import android.support.v7.widget.GridLayoutManager;

import com.biaoyoo.www.personapp.core.BaseListDefineActivity;

/**
 * <pre>
 *     author : 40575
 *     e-mail : huyongxi2015@gmail.com
 *     time   : 2017/05/31
 *     desc   :
 *     version: 1.0
 * </pre>
 */
public class FooterSpanSizeLookup extends GridLayoutManager.SpanSizeLookup {

    private BaseListDefineActivity.BaseListDefineAdapter adapter;
    private int spanCount;

    public FooterSpanSizeLookup(BaseListDefineActivity.BaseListDefineAdapter adapter, int spanCount) {
        this.adapter = adapter;
        this.spanCount = spanCount;
    }
    @Override
    public int getSpanSize(int position) {
        if (adapter.isFooterView(position)) {
            return spanCount;
        }
        return 1;
    }
}
